<template>
  <div :style="outModuleCss">
    <div :style="moduleBgCss" class="module-bg"></div>
    <div class="diy-notice">
      <div v-if="propsData.params.styleType != 2" class="notice-banner">
        <img
          v-if="propsData.params.noticeImg && propsData.params.styleType == 3"
          :src="propsData.params.noticeImg"
          alt=""
        />
        <img v-else src="@/assets/images/diy/diy_notice_img.png" alt="" />
      </div>
      <div v-else class="notice-icon">
        <img src="@/assets/images/diy/notice_slide-icon.png" alt="" />
      </div>
      <div class="split-line"></div>
      <div class="text-slider">
        <div class="slider-item slider-first">
          {{ propsData.params.noticeText }}
        </div>
        <div class="slider-item slider-second">
          {{ propsData.params.noticeText }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mixinsModuleCss } from "@/components/DiyNew/diy/mixins/index.js";

export default {
  name: "diyNotice",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
  },
  mixins: [mixinsModuleCss],
  components: {},
  data() {
    return {};
  },
};
</script>

<style lang="scss" scoped>
.module-bg {
  width: 100%;
  height: 100%;
  z-index: -1;
  position: absolute;
  left: 0;
  top: 0;
}
.diy-notice {
  width: 100%;
  height: 44px;
  // background-color: #ffffff;
  display: flex;
  align-items: center;
  padding: 0 14px;

  .notice-banner {
    width: 76px;
    height: 20px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .notice-icon {
    width: 23px;
    height: 100%;
    line-height: 44px;
    img {
      width: 100%;
    }
  }
  .split-line {
    width: 1px;
    height: 16px;
    background: #ebebeb;
    margin: 0 9px;
  }
  .text-slider {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    .slider-item {
      height: 100%;
      width: 100%;
      position: absolute;
      left: 252px;
      top: 0;
      line-height: 44px;
      z-index: 11;
      transition: all 0.2s;
    }
    .slider-first {
      animation: slideLeft 9s 0.2s linear infinite;
    }
    .slider-second {
      animation: slideLateLeft 9s 4.7s linear infinite;
    }
    @keyframes slideLeft {
      0% {
        left: 252px;
        opacity: 1;
      }
      49% {
        opacity: 1;
        left: -252px;
      }
      50% {
        opacity: 0;
        left: -252px;
      }
      99% {
        opacity: 0;
        left: 252px;
      }
      100% {
        opacity: 1;
        left: 252px;
      }
    }
    @keyframes slideLateLeft {
      0% {
        left: 252px;
        opacity: 1;
      }
      49% {
        opacity: 1;
        left: -252px;
      }
      50% {
        opacity: 0;
        left: -252px;
      }
      99% {
        opacity: 0;
        left: 252px;
      }
      100% {
        opacity: 1;
        left: 252px;
      }
    }
  }
}
</style>